<template>
    <tr-card margin="0 0 12rpx" :padding="padding" @tap="toOrder">
        <view class="row-grid grid3">
            <view></view>
            <view class="date-text">2025-05-05</view>
            <view>
                <view>人数：23</view>
                <view>组数：23</view>
            </view>
        </view>
        <view class="card-row">
            8:00心意广场2703a
        </view>
        <view class="row-grid grid2">
            <view class="card-row">
                <view class="label">{{$t("common.guide")}}：</view>
                <view class="value">张三张三</view>
            </view>
            <view class="card-row">
                <view class="label">{{$t("common.phone")}}：</view>
                <view class="value">17897897897</view>
            </view>
        </view>
        <view class="row-grid grid2">
            <view class="card-row">
                <view class="label">{{$t("common.driver")}}：</view>
                <view class="value">李四</view>
            </view>
            <view class="card-row">
                48座
            </view>
        </view>
        <view class="row-grid grid2">
            <view class="card-row">
                <view class="label">{{$t("common.phone")}}：</view>
                <view class="value">14567897897</view>
            </view>
            <view class="card-row">
                <view class="label">{{$t("common.carNumber")}}：</view>
                <view class="value">1234(蓝色)</view>
            </view>
        </view>
        <view class="row-grid grid2">
            <view class="card-row">
                <view class="label">牛肉套餐：</view>
                <view class="value">14人</view>
            </view>
            <view class="card-row">
                <view class="label">小火车：</view>
                <view class="value">20人</view>
            </view>
        </view>
        <view class="row-grid grid2">
            <view class="card-row">
                <view class="label">{{$t("common.fleetAdvanceAmount")}}：</view>
                <view class="value">200</view>
            </view>
            <view class="card-row grid-gap24">
                <view>
                    <up-button :text="$t('common.uncollectedPayment')" type="primary" shape="circle" plain size="small"></up-button>
                </view>
                <view>
                    <up-button :text="$t('common.uploadInvoice')" type="primary" shape="circle" plain size="small"></up-button>
                </view>
            </view>
        </view>
        <view class="card-row desc">
            请联系导游张三拿钱 电话：17897897897
        </view>
        <view v-if="!disabled" class="btn-box">
            <view>
                <up-tag :text="$t('common.takePhotosEnd')" shape="circle" size="large" plain @tap="chooseImage"></up-tag>
            </view>
            <view>
                <up-tag :text="$t('common.viewThePhoto')" shape="circle" size="large" plain @tap="viewPhotos"></up-tag>
            </view>
            <view>
                <up-tag :text="$t('common.driverEvaluation')" shape="circle" size="large" plain @tap="driverComment"></up-tag>
            </view>
            <view>
                <up-tag :text="$t('common.SeatingArrangement')" shape="circle" size="large" plain @tap="toSeat"></up-tag>
            </view>
        </view>
    </tr-card>
    
    <!--    查看拍照-->
    <tr-view-photos ref="viewPhotosRef"/>
    
    <!--    司机评价-->
    <tr-driver-comment ref="driverCommentRef" disabled/>
</template>
<script setup>
const props = defineProps({
    disabled: {
        type: Boolean,
        default: false
    },
    padding: {
        type: String,
        default: '24rpx'
    }
})
const viewPhotosRef = ref()
const driverCommentRef = ref()

const viewPhotos = () => {
    viewPhotosRef.value.open()
}

const driverComment = () => {
    driverCommentRef.value.open()
}

const chooseImage = () => {
    uni.chooseImage({
        count: 1,
        sizeType: ['original', 'compressed'],
        sourceType: ['camera', 'album'], //这要注意，camera掉拍照，album是打开手机相册
        success: (res) => {
            console.log(res);
            const tempFilePaths = res.tempFilePaths;
        }
    });
}
// 全部订单
const toOrder = () => {
    if (props.disabled) {
        return
    }
    qly.page.open('/pages/home/order/index')
}

// 座位排布
const toSeat = () => {
    console.log('座位')
    qly.page.open('/pages/home/seat/index')
}
</script>
<style scoped lang="scss">
.btn-box {
    display: flex;
    flex-wrap: wrap;
    gap: 24rpx;
    justify-content: flex-end;
    margin-top: 18rpx;
}
</style>
